<script>
	var pnum = {$pnum};
	{if condition="(isset($filter)) AND ($filter)"}
	var filter = {$filter};
	{/if}
	{if condition="(!isset($search)) OR (!$search)"}
	var search = 0;
	var goUrl = "/{$Request.module}/assemble/lst/filter/"+filter+".html?page="+pnum;
	{else/}
	var search = {$search};
	var goUrl = "/{$Request.module}/assemble/search.html?page="+pnum;
	{/if}

    var sortUrl = "{:url('assemble/order')}";
    $(function(){
        $("#checkAll").click(function () {
            $("input[class='text_id']:checkbox").prop("checked", this.checked);
        });
    });
</script>


<table class="table table-hover table-bordered">
                            <thead>
                                <tr>
                                    <th style="width:3%"><input type="checkbox" id="checkAll"/></th>
                                    <th style="width:5%">ID</th>
                                    <th style="width:10%">拼团名称</th>
                                    <th style="width:20%">商品信息</th>
                                    <th style="width:10%">拼团价</th>
                                    <th style="width:10%">几人团</th>
                                    <th style="width:15%">活动时间</th>
                                    <th style="width:5%">状态</th>
                                    <th style="width:5%">结束时间</th>
                                    <th style="width:5%">推荐</th>
                                    <th style="width:5%">排序</th>
                                    <th style="width:15%">操作</th>
                                </tr>
                            </thead>
                            <tbody>
                            {if condition="!empty($list)"}
							{foreach name="list" item="v"}
                                <tr>
                                    <td><input type="checkbox" class="text_id" name="id[]" value="{$v.id}" /></td>
                                    <td>{$v.id}</td>
                                    <td>{$v.pin_name}</td>
                                    <td>{$v.goods_name}&nbsp;&nbsp;{$v.goods_attr_str}</td>
                                    <td>{$v.price}</td>
                                    <td>{$v.pin_num}人团</td>
                                    <td>起：{:date('Y-m-d H:i:s',$v['start_time'])}<br>止：{:date('Y-m-d H:i:s',$v['end_time'])}</td>
                                    <td>
                                        {if condition="$v['zhuangtai'] eq 1"}
                                        <span style="color:#1c84c6;">即将开始</span>
                                        {elseif condition="$v['zhuangtai'] eq 2"/}
                                        <span style="color:#1c84c6;">抢购中</span>
                                        {elseif condition="$v['zhuangtai'] eq 3"/}
                                        <span style="color:#ed5565;">自动结束</span>
                                        {elseif condition="$v['zhuangtai'] eq 4"/}
                                        <span style="color:#ed5565;">手动结束</span>
                                        {elseif condition="$v['zhuangtai'] eq 5"/}
                                        <span style="color:#ed5565;">待审核</span>
                                        {elseif condition="$v['zhuangtai'] eq 6"/}
                                        <span style="color:#ed5565;">审核未通过</span>
                                        {/if}
                                    </td>
                                    <td align="center">
                                        {if condition="empty($v['finish_time'])"}
                                        -
                                        {else}
                                        {$v['finish_time']|date="Y-m-d H:i:s",###}
                                        {/if}
                                    </td>
                                    <td>
                                        {switch name="$v.recommend"}
                                        {case value="1"}
                                        <button class="btn btn-primary btn-xs" type="button" onclick="changeTableVal({$v.id},'recommend',this);"><i class="fa fa-check"></i></button>
                                        {/case}
                                        {case value="0"}
                                        <button class="btn btn-danger btn-xs" type="button" onclick="changeTableVal({$v.id},'recommend',this);"><i class="fa fa-times"></i></button>
                                        {/case}                                    
                                        {/switch}
                                    </td>
                                    <td><input name="{$v.id}" typed="text" value="{$v.sort}" class="sort" size="1" /></td>
                                    <td>     
                                        <button type="button" class="btn btn-info btn-xs" onclick="group_info({$v.id},this);"><i class="fa fa-paste"></i>&nbsp;详细</button>&nbsp;&nbsp;&nbsp;&nbsp;
                                        <button type="button" class="btn btn-danger btn-xs"  {if condition="$v['finish_status'] neq 0"} disabled {/if} onclick="finishStatus({$v.id});"><i class="fa fa-close"></i>&nbsp;手动结束</button>
                                        <button type="button" class="btn btn-danger btn-xs" onclick="delone({$v.id},this);"><i class="fa fa-close"></i>&nbsp;删除</button>
                                    </td>
                                </tr>
							{/foreach}
							{else/}
							<tr><td colspan="9" style="text-align:center; font-size:14px;">没有找到相关数据</td></tr>
							{/if}				
                            </tbody>
                        </table>
                        <div class="row"><div class="pagination" style="float:right; margin-right:20px;">{$page}</div></div>